import request from "@/utils/request";

// 查询客户等级列表
export function listLevel(query) {
  return request({
    url: "/customer/level/list",
    method: "get",
    params: query,
  });
}

// 查询客户等级详细
export function getLevel(id) {
  return request({
    url: "/customer/level/" + id,
    method: "get",
  });
}

// 新增客户等级
export function addLevel(data) {
  return request({
    url: "/customer/level/add",
    method: "post",
    data: data,
  });
}

// 修改客户等级
export function updateLevel(data) {
  return request({
    url: "/customer/level/edit",
    method: "put",
    data: data,
  });
}

// 删除客户等级
export function delLevel(id) {
  return request({
    url: "/customer/level/remove/" + id,
    method: "delete",
  });
}

// 检查等级是否在使用中
export function checkLevelUsed(id) {
  return request({
    url: "/customer/level/checkUsed/" + id,
    method: "get",
  });
}
